<?php

require("../function/util.php");
$id = $_GET['id'];

$sql = "SELECT * FROM content WHERE content_id = " . $id;
$result = mysql_fetch_assoc(runSQL($sql));
$content_text = str_replace("&nbsp;","&amp;nbsp;",addslashes($result['content_text']));

?>

<link type="text/css" href="../css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="../plugin/js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript">
    function fancyboxClose(){
        $.fancybox.close();
        $("#flex1").flexReload();
    }
</script>
<script>
    $(function() {
        $("#broadcast_date").datepicker();
        $("#start_date_time_date").datepicker();
        $("#end_date_time_date").datepicker();
    });
</script>
<style type="text/css">
    .ui-datepicker{
        width:150px;
        font-family:tahoma;
        font-size:11px;
        text-align:center;
    }
</style>

<div class="main-content resize" id="data" style="width:900px;">
    <h1>Modify Content</h1>
    <p></p>
    <br clear="all" />
    <form name="frm" method="post" action="edit.php" enctype="multipart/form-data" target="ifrm">

		<input type="hidden" name="content_id" value="<?= $id ?>" />
		
        <div id="error" style="color:#ff0000"></div>
        <table cellpadding="0" cellspacing="0" border="0">

			<tr>
                <td class="label" style="width:250px;"><label for="content_position">Position</label></td>
                <td class="field">
                    <textarea id="content_position" name="content_position" rows="1" size="20" style='overflow:hidden;width:400px' tabindex="1"><?= stripslashes($result['content_position']); ?></textarea>
                </td>
            </tr>
            <tr>
                <td class="label"><label for="content_text">Text</label></td>
                <td class="field">
                    <textarea id="content_text" name="content_text" size="20" style='width:600px;height:400px' tabindex="1"><?= $content_text; ?></textarea>
                </td>
            </tr>			
		
            <tr>			
                <td></td>
                <td>
                    <div class="buttonSubmit">
                        <span></span>
                        <input type="submit" value="Submit" style="width: 100px" tabindex="14" />
                        <input type="button" value="Cancel" style="width: 100px" tabindex="15" onClick="fancyboxClose();" id="cancel_button"/>
                        <input type="button" value="Reset Form" style="width: 100px" onClick="this.form.reset()"  tabindex="15" />
                    </div>
                </td>
            </tr>			
			
        </table> 
    </form>
    <iframe name="ifrm" style="display:none;"> </iframe>
</div>	<!-- end main content  --> 